<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>上传新文件</title>
<link rel="stylesheet" type="text/css" href="../css/style1.css" />
<link rel="stylesheet" type="text/css" href="../css/base.css" />
<link rel="stylesheet" type="text/css" href="../css/indexbody.css" />
<script type="text/javascript" src="../js/frame.js"></script>
<script type="text/javascript" src="../js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="../js/jquery.easydrag.handler.beta2.js"></script>
<script type="text/javascript"
	src="../js/jquery.easydrag.handler.beta2.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.5.1.min.js"
	type="text/javascript"></script>
<script type="text/javascript"
	src="http://fromvega.com/code/easydrag/jquery.easydrag.handler.beta2.js"></script>

<style type="text/css">
.pop_box {
	z-index: 9999; /*这个数值要足够大，才能够显示在最上层*/
	display: none;
	position: absolute;
	background: #F6F6F6;
	border: 0px solid #373737;
	height: 30px;
	width: 242px;
}


.p_h_x {
	float: right;
	text-align: center;
	height: 30px;
	width: 10px;
	line-height: 30px;
	color: red;
	font-size: 12px;
	font-weight: bold;
	cursor: pointer;
}
#center {
	margin-left:0px;
	width: 242px;
}
#loading {
	width: 240px;
	height: 29px;
	background: url(../images/p.png) no-repeat;
}

#loading div {
	width: 0px;
	height: 28px;
	background: url(../images/b.png) no-repeat;
	color: #fff;
	text-align: center;
	font-family: Tahoma;
	font-size: 18px;
	line-height: 28px;
}

#message {
	width: 200px;
	height: 35px;
	font-family: Tahoma;
	font-size: 12px;
	background-color: #d8e7f0;
	border: 1px solid #187CBE;
	display: none;
	line-height: 35px;
	text-align: center;
	margin-bottom: 10px;
	margin-left: 50px;
}
</style>
<script type="text/javascript">
	var progress_id = "loading";
	function SetProgress(progress) {
		if (progress) {
			$("#" + progress_id + " > div")
					.css("width", String(progress) + "%"); //控制#loading div宽度 
			$("#" + progress_id + " > div").html(String(progress) + "%"); //显示百分比 
		}
	}
	var i = 0;
	function doProgress() {
		var pBytesRead = 0;
		var pContentLength = 0;
		var pItems = 0;
		var timestamp = (new Date()).valueOf();
		$.getJSON("http://localhost:8080/ggcms/getBar", {
			"t" : timestamp
		}, function(data) {
			pBytesRead = data.pBytesRead;
			pContentLength = data.pContentLength;
			pItems = data.pItems;
			i = pBytesRead / pContentLength;

		});
		i = parseInt(i * 100);
		if (i > 100) {
			$("#" + progress_id + " > div").html("加载完毕！").fadeIn("slow");//加载完毕提示 
			return;
		}
		if (i <= 100) {
			setTimeout("doProgress()", 100);
			SetProgress(i);
		}
	}
	$(document).ready(function() {

	});
	function onlic() {
		popupDiv('pop_div');

		doProgress();
	}

	function popupDiv(div_id) {
		var div_obj = $("#" + div_id);
		//窗口宽度,高度
		var winWidth = $(window).width();
		var winHeight = $(window).height();
		//弹出的div的宽度,高度
		var popHeight = div_obj.height();
		var popWidth = div_obj.width();
		div_obj.animate({
			opacity : "show",
			left : (winWidth - popWidth) / 2,
			top : (winHeight - popHeight) / 2,
			width : popWidth,
			height : popHeight
		}, 300);

	}

	function hideDiv(div_id) {
		$("#" + div_id).animate({
			opacity : "hide"
		}, 300);
	}

	$(function() {
		$(".pop_box").easydrag();
		$(".pop_box").setHandler(".pop_box .p_head");

	});
</script>
</head>
<body background="../images/allbg.gif">
<div id="container">
<jsp:include page="../header.jsp"></jsp:include>
<div style="float:left; width:195px; height: 550px">
<jsp:include page="../leftnav.jsp"></jsp:include>
</div>
<div
	style="float:left; overflow-y:scroll; overflow-x:hidden; width: 785px; height: 550px;">

<table width="98%" align="center" border="0" cellpadding="3"
	cellspacing="1" bgcolor="#D6D6D6">
<tr>
<td height="28" style="background-image:'../images/tbg.gif'"> <table
	width="98%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="2%" align="center" valign="middle"><img
	src="../images/item_tt2.gif" width="7" height="15" /> </td>
<td width="44%"><strong>上传新文件：</strong> </td>
</tr>
</table> </td>
</tr>
<tr>
<td height="69" align="center" valign="top" bgcolor="#FFFFFF"> <form
	action="<%=path%>/manager/media/muchupload!upload.action"
	id="uploadForm" enctype="multipart/form-data" method="post">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="15%" height="30" align="center" bgcolor="#FFFFFF"
	class='bline'>媒体类型：</td>
<td width="85%" height="25" bgcolor="#FFFFFF" class='bline'
	style="text-align:left;"> <input type="radio" name="mediatype"
	class="np" value="2" /> 图片 <input type="radio" name="mediatype"
	class="np" value="2" /> 软件 <input type="radio" name="mediatype"
	class="np" value="4" /> 附件/其它</td>
</tr>
<tr>
<td height="30" align="center" bgcolor="#FFFFFF" class='bline'>上传文件：</td>
<td bgcolor="#FFFFFF" class='bline' style="text-align:left;">数量： <input
	name="picnum" type="text" id="picnum" value="1" size="6"
	style="margin-top: -4px; padding-top: -4px;" /> <input type="button"
	name="Submit" value="增加" onclick="MakeUpload()" /> &nbsp; <input
	type="button" name="Submit" value="恢复" onclick="ResetUpload()" /> </td>
</tr>
<tr>
<td align="center" bgcolor="#FFFFFF">&nbsp;</td>
<td bgcolor="#FFFFFF" style="text-align:left;"><input name="file"
	type="file" id="upfile1" style='width:300px' size='30'
	class='pubinputs' /><br /> <input name="file" type="file"
	id="upfile1" style='width:300px' size='30' class='pubinputs' /><br />
<span id='uploadfield'></span> </td>
</tr>
<tr>
<td height="20" colspan="2" bgcolor="#FFFFFF"><input type="submit"
	id="subButton" value="上传" onclick="onlic()" /> </td>
</tr>

</table>
</form> </td>
</tr>
</table>
</div>
</div>
<div id='pop_div' class="pop_box">
<div id="center">
<div id="loading">
<div></div>
</div>
</div>
</div>
</div>
<div class="p_box_body" id="p_b_body" runat="server"></div>
</div>
</body>
</html>